   1              		.syntax unified
   2              		.cpu cortex-m3
   3              		.fpu softvfp
   4              		.eabi_attribute 20, 1
   5              		.eabi_attribute 21, 1
   6              		.eabi_attribute 23, 3
   7              		.eabi_attribute 24, 1
   8              		.eabi_attribute 25, 1
   9              		.eabi_attribute 26, 1
  10              		.eabi_attribute 30, 4
  11              		.eabi_attribute 34, 1
  12              		.eabi_attribute 18, 4
  13              		.thumb
  14              		.syntax unified
  15              		.file	"servus.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.section	.text.servus_SetPin,"ax",%progbits
  20              		.align	1
  21              		.thumb
  22              		.thumb_func
  24              	servus_SetPin:
  25              	.LFB10:
  26              		.file 1 "uc_libc_dev/motors/servus.c"
   1:uc_libc_dev/motors/servus.c **** #include "servus.h"
   2:uc_libc_dev/motors/servus.c **** 
   3:uc_libc_dev/motors/servus.c **** // COMPORTAMENTO DO SERVOS - resolução em 10uS
   4:uc_libc_dev/motors/servus.c **** //                       TH             TL
   5:uc_libc_dev/motors/servus.c **** // Pulso para o servo: ######________________________
   6:uc_libc_dev/motors/servus.c **** //
   7:uc_libc_dev/motors/servus.c **** // Tempos TH	Servo normal	Servo de modo continuo
   8:uc_libc_dev/motors/servus.c **** // 1000ms		0º 				Máxima velocidade sentido antihorário
   9:uc_libc_dev/motors/servus.c **** // 1250ms		45º 			Média velocidade sentido antihorário
  10:uc_libc_dev/motors/servus.c **** // 1500ms		90º				Parado
  11:uc_libc_dev/motors/servus.c **** // 1750ms		135º 			Média velocidade sentido horário
  12:uc_libc_dev/motors/servus.c **** // 2000ms		180º			Máxima velocidade sentido horário
  13:uc_libc_dev/motors/servus.c **** // TL = 20ms
  14:uc_libc_dev/motors/servus.c **** 
  15:uc_libc_dev/motors/servus.c **** 
  16:uc_libc_dev/motors/servus.c **** // COMPORTAMENTO DO SENSORES ULTRASOM
  17:uc_libc_dev/motors/servus.c **** //          (10uS) trigger      (200uS) Tempo de   	    (200uS) Tempo que o  	(100us) Resposta 	(38
  18:uc_libc_dev/motors/servus.c **** //			 para o módulo	  excitação do ultrasom      módulo espera para  	 de aceitação		   Quando enco
  19:uc_libc_dev/motors/servus.c **** //							   (8 pulsos de 40Khz)	  começar a leiturado eco      do trigger
  20:uc_libc_dev/motors/servus.c **** // --------|--------------|-------------------------|-------------------------|-------------------|
  21:uc_libc_dev/motors/servus.c **** // _________HHHHHHHHHHHHHH_________________________________________________________________________
  22:uc_libc_dev/motors/servus.c **** // ________________________XXXXXXXXXXXXXXXXXXXXXXXXX_______________________________________________
  23:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHH_
  24:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHHH
  25:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHHH
  26:uc_libc_dev/motors/servus.c **** //		O pino echo elevará após a exicitação do ultrasom (8 pulsos de 40Khz) e ficará em alta pelo men
  27:uc_libc_dev/motors/servus.c **** 
  28:uc_libc_dev/motors/servus.c **** // ATENÇÃO: O período de medição no hc-sr04 é de 50ms, se houver outro trigger dentro desse interva
  29:uc_libc_dev/motors/servus.c **** 
  30:uc_libc_dev/motors/servus.c **** 
  31:uc_libc_dev/motors/servus.c **** #if (US04_USES == pdON)
  32:uc_libc_dev/motors/servus.c **** typedef struct {
  33:uc_libc_dev/motors/servus.c **** 	unsigned modeContinuous:1;				// Sinaliza para ficar fazendo medição de forma continua ou não
  34:uc_libc_dev/motors/servus.c **** 	volatile unsigned measure:1; 			// Sinaliza quando começar as medições
  35:uc_libc_dev/motors/servus.c **** 	volatile unsigned done:1;				// Sinaliza quando as medições estão prontas
  36:uc_libc_dev/motors/servus.c **** 	volatile int Fdetected;
  37:uc_libc_dev/motors/servus.c **** 	volatile int Ftriggerok;
  38:uc_libc_dev/motors/servus.c **** 	volatile uint FCont;					// Contador micro segundos para o gerenciador do US
  39:uc_libc_dev/motors/servus.c **** 	volatile int FModule;					// Guarda o módulo atual para medição
  40:uc_libc_dev/motors/servus.c **** 	volatile uint measurements[US04_N_MODULE];
  41:uc_libc_dev/motors/servus.c **** } tUs04;
  42:uc_libc_dev/motors/servus.c **** static tUs04 us04;
  43:uc_libc_dev/motors/servus.c **** static void us04_Trigger(uint module, uint action);
  44:uc_libc_dev/motors/servus.c **** static uint us04_Echo(uint module);
  45:uc_libc_dev/motors/servus.c **** #endif // #if (US04_USES == pdON)
  46:uc_libc_dev/motors/servus.c **** 
  47:uc_libc_dev/motors/servus.c **** typedef struct {
  48:uc_libc_dev/motors/servus.c **** 	volatile unsigned enable:1;
  49:uc_libc_dev/motors/servus.c **** 	volatile uint pos;
  50:uc_libc_dev/motors/servus.c **** 	volatile uint pos_load;
  51:uc_libc_dev/motors/servus.c **** 	volatile uint pos_count;
  52:uc_libc_dev/motors/servus.c **** 	volatile uint interval_count;
  53:uc_libc_dev/motors/servus.c **** 		#define INTERVAL_COUNT 20000
  54:uc_libc_dev/motors/servus.c **** } tServoCtrl;
  55:uc_libc_dev/motors/servus.c **** 
  56:uc_libc_dev/motors/servus.c **** static tServoCtrl servoCtrl[SERVO_N_MODULE];
  57:uc_libc_dev/motors/servus.c **** 
  58:uc_libc_dev/motors/servus.c **** static void servus_CallSytem(void);
  59:uc_libc_dev/motors/servus.c **** 
  60:uc_libc_dev/motors/servus.c **** void servus_Init(uint en) {
  61:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
  64:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos= 1500;
  65:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
  66:uc_libc_dev/motors/servus.c **** 	}
  67:uc_libc_dev/motors/servus.c **** 
  68:uc_libc_dev/motors/servus.c **** 	#if (US04_USES == pdON)
  69:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule1();
  70:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
  71:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule2();
  72:uc_libc_dev/motors/servus.c **** 	#endif
  73:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
  74:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule3();
  75:uc_libc_dev/motors/servus.c **** 	#endif
  76:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
  77:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule4();
  78:uc_libc_dev/motors/servus.c **** 	#endif
  79:uc_libc_dev/motors/servus.c **** 
  80:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = 0;	// Não medir de forma continua
  81:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 			// Sinaliza para não fazer as medições
  82:uc_libc_dev/motors/servus.c **** 	us04.done = 0;				// Nenhuma medição foi realizada ainda
  83:uc_libc_dev/motors/servus.c **** 	us04.FModule = 1;			// Sinaliza que o módulo 1 será o primeiro a ser medido
  84:uc_libc_dev/motors/servus.c **** 	us04.FCont = 0;				// Contador em micro segundos do CallSystem do US
  85:uc_libc_dev/motors/servus.c **** 
  86:uc_libc_dev/motors/servus.c **** 	for (x=0;x<US04_N_MODULE;x++) {
  87:uc_libc_dev/motors/servus.c **** 		us04.measurements[x] = 0;
  88:uc_libc_dev/motors/servus.c **** 		us04_Trigger(x, pdOFF); // Desligar sinais dos triggers dos módulos
  89:uc_libc_dev/motors/servus.c **** 	}
  90:uc_libc_dev/motors/servus.c **** 
  91:uc_libc_dev/motors/servus.c **** 	us04.Fdetected = 0;		// Sinaliza para não há objeto detectado
  92:uc_libc_dev/motors/servus.c **** 	us04.Ftriggerok = 0;		// Inicializar pedido de trigger
  93:uc_libc_dev/motors/servus.c **** 
  94:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdON
  95:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGER_DIR |= US04_DBGTRIGGER;
  96:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGER_CLR = US04_DBGTRIGGER;
  97:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGEROK_DIR |= US04_DBGTRIGGEROK;
  98:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
  99:uc_libc_dev/motors/servus.c **** 	US04_DBGDETECTED_DIR |= US04_DBGDETECTED;
 100:uc_libc_dev/motors/servus.c **** 	US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 101:uc_libc_dev/motors/servus.c **** 	#endif
 102:uc_libc_dev/motors/servus.c **** 	#endif //#if (US04_USES == pdON)
 103:uc_libc_dev/motors/servus.c **** 
 104:uc_libc_dev/motors/servus.c **** 	servo1_SetupPorts();
 105:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 106:uc_libc_dev/motors/servus.c **** 	servo2_SetupPorts();
 107:uc_libc_dev/motors/servus.c **** 	#endif
 108:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 2)
 109:uc_libc_dev/motors/servus.c **** 	servo3_SetupPorts();
 110:uc_libc_dev/motors/servus.c **** 	#endif
 111:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 3)
 112:uc_libc_dev/motors/servus.c **** 	servo4_SetupPorts();
 113:uc_libc_dev/motors/servus.c **** 	#endif
 114:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 4)
 115:uc_libc_dev/motors/servus.c **** 	servo5_SetupPorts();
 116:uc_libc_dev/motors/servus.c **** 	#endif
 117:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 5)
 118:uc_libc_dev/motors/servus.c **** 	servo6_SetupPorts();
 119:uc_libc_dev/motors/servus.c **** 	#endif
 120:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 6)
 121:uc_libc_dev/motors/servus.c **** 	servo7_SetupPorts();
 122:uc_libc_dev/motors/servus.c **** 	#endif
 123:uc_libc_dev/motors/servus.c **** 
 124:uc_libc_dev/motors/servus.c **** 	servus_TimeInit();
 125:uc_libc_dev/motors/servus.c **** 	servus_SetIntHandler(servus_CallSytem);
 126:uc_libc_dev/motors/servus.c **** }
 127:uc_libc_dev/motors/servus.c **** 
 128:uc_libc_dev/motors/servus.c **** void servus_Finish(void) {
 129:uc_libc_dev/motors/servus.c **** 	servus_TimeStop();		// Desligo o timer para não gerar int para servus_CallSytem
 130:uc_libc_dev/motors/servus.c **** }
 131:uc_libc_dev/motors/servus.c **** 
 132:uc_libc_dev/motors/servus.c **** 
 133:uc_libc_dev/motors/servus.c **** #if (US04_USES == pdON)
 134:uc_libc_dev/motors/servus.c **** 
 135:uc_libc_dev/motors/servus.c **** // Inicializa a medição com ultrasom com modo continuo ou uma única medição
 136:uc_libc_dev/motors/servus.c **** // parametro modeCont:  pdFALSE: sinaliza para fazer uma única medição
 137:uc_libc_dev/motors/servus.c **** //						pdTRUE: Sinaliza para medir de forma continua
 138:uc_libc_dev/motors/servus.c **** void us04_StartMeasure(uint modeCont) {
 139:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = modeCont;
 140:uc_libc_dev/motors/servus.c **** 	if (us04.measure) return;
 141:uc_libc_dev/motors/servus.c **** 	us04.done = 0; 			// Sinaliza que a conversão não está pronta
 142:uc_libc_dev/motors/servus.c **** 	us04.measure = 1; 		// Sinaliza para fazer as medições
 143:uc_libc_dev/motors/servus.c **** }
 144:uc_libc_dev/motors/servus.c **** 
 145:uc_libc_dev/motors/servus.c **** // para qualquer medição seja no modo continuo ou não
 146:uc_libc_dev/motors/servus.c **** void us04_StopMeasure(void) {
 147:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = 0;
 148:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 		// Sinaliza para fazer as medições
 149:uc_libc_dev/motors/servus.c **** }
 150:uc_libc_dev/motors/servus.c **** 
 151:uc_libc_dev/motors/servus.c **** // Retorna em CM o valor lido pelo módulo US
 152:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a US04_N_MODULE
 153:uc_libc_dev/motors/servus.c **** // Retorna: 0: Se não encontrou o ostáculo, senão retorna com o valor em centimetros
 154:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o módulo não existe
 155:uc_libc_dev/motors/servus.c **** //			errDEVICE_VALUE_NOT_READY: Se o módulo ainda não terminou a medição
 156:uc_libc_dev/motors/servus.c **** int us04_ReadMeasureCM(uint module) {
 157:uc_libc_dev/motors/servus.c **** 	if ( (module == 0) || (module > US04_N_MODULE)) return errDEVICE_NOT_FOUND;
 158:uc_libc_dev/motors/servus.c **** 	if (us04.done == 0) return errDEVICE_VALUE_NOT_READY;
 159:uc_libc_dev/motors/servus.c **** 	if (us04.measurements[module-1] == 0) return 0;
 160:uc_libc_dev/motors/servus.c **** 	return (us04.measurements[module-1]/58);
 161:uc_libc_dev/motors/servus.c **** }
 162:uc_libc_dev/motors/servus.c **** 
 163:uc_libc_dev/motors/servus.c **** // Ligar ou desligar o trigger do módulo
 164:uc_libc_dev/motors/servus.c **** static void us04_Trigger(uint module, uint action) {
 165:uc_libc_dev/motors/servus.c **** 	if (module == 1) us04_TriggerModule1(action);
 166:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 167:uc_libc_dev/motors/servus.c **** 	if (module == 2) us04_TriggerModule2(action);
 168:uc_libc_dev/motors/servus.c **** 	#endif
 169:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
 170:uc_libc_dev/motors/servus.c **** 	if (module == 3) us04_TriggerModule3(action);
 171:uc_libc_dev/motors/servus.c **** 	#endif
 172:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
 173:uc_libc_dev/motors/servus.c **** 	if (module == 4) us04_TriggerModule4(action);
 174:uc_libc_dev/motors/servus.c **** 	#endif
 175:uc_libc_dev/motors/servus.c **** }
 176:uc_libc_dev/motors/servus.c **** 
 177:uc_libc_dev/motors/servus.c **** // retorna 1 se o pino de eco = 1 senão retorna 0
 178:uc_libc_dev/motors/servus.c **** static uint us04_Echo(uint module) {
 179:uc_libc_dev/motors/servus.c **** 	uint result = 0;
 180:uc_libc_dev/motors/servus.c **** 	if ((module == 1) && (us04_EchoModule1() > 0)) result = 1;
 181:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 182:uc_libc_dev/motors/servus.c **** 	if ((module == 2) && (us04_EchoModule2() > 0)) result = 1;
 183:uc_libc_dev/motors/servus.c **** 	#endif
 184:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
 185:uc_libc_dev/motors/servus.c **** 	if ((module == 3) && (us04_EchoModule3() > 0)) result = 1;
 186:uc_libc_dev/motors/servus.c **** 	#endif
 187:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
 188:uc_libc_dev/motors/servus.c **** 	if ((module == 4) && (us04_EchoModule4() > 0)) result = 1;
 189:uc_libc_dev/motors/servus.c **** 	#endif
 190:uc_libc_dev/motors/servus.c **** 
 191:uc_libc_dev/motors/servus.c **** 	return result;
 192:uc_libc_dev/motors/servus.c **** }
 193:uc_libc_dev/motors/servus.c **** #endif //#if (US04_USES == pdON)
 194:uc_libc_dev/motors/servus.c **** 
 195:uc_libc_dev/motors/servus.c **** // Determina a posição do servo motor
 196:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 197:uc_libc_dev/motors/servus.c **** // 				us: tempo em microsegundos, deve ser multiplo de 10 por causa da cntagem do timer ser de 10 
 198:uc_libc_dev/motors/servus.c **** // Retorna: pdPASS se o comando foi executado com sucesso
 199:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 200:uc_libc_dev/motors/servus.c **** //			errDEVICE_VALUE_INVALID: Valor inválido
 201:uc_libc_dev/motors/servus.c **** int servus_SetPos(uint servo, uint us) {
 202:uc_libc_dev/motors/servus.c **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 203:uc_libc_dev/motors/servus.c **** 	if ( (us<minSERVO_US_WIDTH) || (us>maxSERVO_US_WIDTH)) return errDEVICE_VALUE_INVALID;
 204:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = (us/10)*10;
 205:uc_libc_dev/motors/servus.c **** 
 206:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 207:uc_libc_dev/motors/servus.c **** }
 208:uc_libc_dev/motors/servus.c **** 
 209:uc_libc_dev/motors/servus.c **** // Habilita não a saida PWM para o servo
 210:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 211:uc_libc_dev/motors/servus.c **** // Retorna: pdPASS se o comando foi executado com sucesso
 212:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 213:uc_libc_dev/motors/servus.c **** int servus_Enable(uint servo, uint en) {
 214:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 215:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 216:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 217:uc_libc_dev/motors/servus.c **** }
 218:uc_libc_dev/motors/servus.c **** 
 219:uc_libc_dev/motors/servus.c **** // Checa se o servo está habilitado ou não
 220:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 221:uc_libc_dev/motors/servus.c **** // Retorna: pdON pu pdOFF
 222:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 223:uc_libc_dev/motors/servus.c **** int servus_Enabled(uint servo) {
 224:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 225:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 226:uc_libc_dev/motors/servus.c **** }
 227:uc_libc_dev/motors/servus.c **** 
 228:uc_libc_dev/motors/servus.c **** static inline void servus_SetPin(uint servo, uint act) {
  27              		.loc 1 228 0
  28              		.cfi_startproc
  29              		@ args = 0, pretend = 0, frame = 0
  30              		@ frame_needed = 0, uses_anonymous_args = 0
  31              		@ link register save eliminated.
  32              	.LVL0:
 229:uc_libc_dev/motors/servus.c **** 	act &= servoCtrl[servo].enable;
  33              		.loc 1 229 0
  34 0000 1423     		movs	r3, #20
  35 0002 4343     		muls	r3, r0, r3
  36 0004 124A     		ldr	r2, .L32
  37 0006 D358     		ldr	r3, [r2, r3]
  38 0008 03F00103 		and	r3, r3, #1
  39 000c 1940     		ands	r1, r1, r3
  40              	.LVL1:
 230:uc_libc_dev/motors/servus.c **** 
 231:uc_libc_dev/motors/servus.c **** 	if (servo == 0) {
  41              		.loc 1 231 0
  42 000e 10B9     		cbnz	r0, .L2
  43 0010 4FF48063 		mov	r3, #1024
  44 0014 0CE0     		b	.L23
  45              	.L2:
 232:uc_libc_dev/motors/servus.c **** 		if (act) SERVO1_SET = SERVO1; else SERVO1_CLR = SERVO1;
 233:uc_libc_dev/motors/servus.c **** 	}
 234:uc_libc_dev/motors/servus.c **** 
 235:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 236:uc_libc_dev/motors/servus.c **** 	if (servo == 1) {
  46              		.loc 1 236 0
  47 0016 0128     		cmp	r0, #1
  48 0018 02D1     		bne	.L5
  49 001a 4FF40073 		mov	r3, #512
  50 001e 07E0     		b	.L23
  51              	.L5:
 237:uc_libc_dev/motors/servus.c **** 		if (act) SERVO2_SET = SERVO2; else SERVO2_CLR = SERVO2;
 238:uc_libc_dev/motors/servus.c **** 	}
 239:uc_libc_dev/motors/servus.c **** 	#endif
 240:uc_libc_dev/motors/servus.c **** 
 241:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 2)
 242:uc_libc_dev/motors/servus.c **** 	if (servo == 2) {
  52              		.loc 1 242 0
  53 0020 0228     		cmp	r0, #2
  54 0022 02D1     		bne	.L8
  55 0024 4FF48073 		mov	r3, #256
  56 0028 02E0     		b	.L23
  57              	.L8:
 243:uc_libc_dev/motors/servus.c **** 		if (act) SERVO3_SET = SERVO3; else SERVO3_CLR = SERVO3;
 244:uc_libc_dev/motors/servus.c **** 	}
 245:uc_libc_dev/motors/servus.c **** 	#endif
 246:uc_libc_dev/motors/servus.c **** 
 247:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 3)
 248:uc_libc_dev/motors/servus.c **** 	if (servo == 3) {
  58              		.loc 1 248 0
  59 002a 0328     		cmp	r0, #3
  60 002c 06D1     		bne	.L29
  61 002e 1023     		movs	r3, #16
  62              	.L23:
 249:uc_libc_dev/motors/servus.c **** 		if (act) SERVO4_SET = SERVO4; else SERVO4_CLR = SERVO4;
 250:uc_libc_dev/motors/servus.c **** 	}
 251:uc_libc_dev/motors/servus.c **** 	#endif
 252:uc_libc_dev/motors/servus.c **** 
 253:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 4)
 254:uc_libc_dev/motors/servus.c **** 	if (servo == 4) {
 255:uc_libc_dev/motors/servus.c **** 		if (act) SERVO5_SET = SERVO5; else SERVO5_CLR = SERVO5;
 256:uc_libc_dev/motors/servus.c **** 	}
 257:uc_libc_dev/motors/servus.c **** 	#endif
 258:uc_libc_dev/motors/servus.c **** 
 259:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 5)
 260:uc_libc_dev/motors/servus.c **** 	if (servo == 5) {
 261:uc_libc_dev/motors/servus.c **** 		if (act) SERVO6_SET = SERVO6; else SERVO6_CLR = SERVO6;
  63              		.loc 1 261 0
  64 0030 09B1     		cbz	r1, .L14
  65              		.loc 1 261 0 is_stmt 0 discriminator 1
  66 0032 084A     		ldr	r2, .L32+4
  67 0034 00E0     		b	.L20
  68              	.L14:
  69              		.loc 1 261 0 discriminator 2
  70 0036 084A     		ldr	r2, .L32+8
  71              	.L20:
  72 0038 1360     		str	r3, [r2]
 262:uc_libc_dev/motors/servus.c **** 	}
 263:uc_libc_dev/motors/servus.c **** 	#endif
 264:uc_libc_dev/motors/servus.c **** 
 265:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 6)
 266:uc_libc_dev/motors/servus.c **** 	if (servo == 6) {
 267:uc_libc_dev/motors/servus.c **** 		if (act) SERVO7_SET = SERVO7; else SERVO7_CLR = SERVO7;
 268:uc_libc_dev/motors/servus.c **** 	}
 269:uc_libc_dev/motors/servus.c **** 	#endif
 270:uc_libc_dev/motors/servus.c **** }
  73              		.loc 1 270 0 is_stmt 1 discriminator 2
  74 003a 7047     		bx	lr
  75              	.L29:
 254:uc_libc_dev/motors/servus.c **** 		if (act) SERVO5_SET = SERVO5; else SERVO5_CLR = SERVO5;
  76              		.loc 1 254 0
  77 003c 0428     		cmp	r0, #4
  78 003e 01D1     		bne	.L30
  79 0040 0223     		movs	r3, #2
  80 0042 F5E7     		b	.L23
  81              	.L30:
 260:uc_libc_dev/motors/servus.c **** 		if (act) SERVO6_SET = SERVO6; else SERVO6_CLR = SERVO6;
  82              		.loc 1 260 0
  83 0044 0528     		cmp	r0, #5
  84 0046 01D1     		bne	.L31
  85 0048 0123     		movs	r3, #1
  86 004a F1E7     		b	.L23
  87              	.L31:
  88 004c 7047     		bx	lr
  89              	.L33:
  90 004e 00BF     		.align	2
  91              	.L32:
  92 0050 00000000 		.word	.LANCHOR0
  93 0054 38C00920 		.word	537509944
  94 0058 3CC00920 		.word	537509948
  95              		.cfi_endproc
  96              	.LFE10:
  98              		.section	.text.servus_CallSytem,"ax",%progbits
  99              		.align	1
 100              		.thumb
 101              		.thumb_func
 103              	servus_CallSytem:
 104              	.LFB11:
 271:uc_libc_dev/motors/servus.c **** 
 272:uc_libc_dev/motors/servus.c **** // Tick de sistema para controle dos servos e medições dos módulos de ultrasom.
 273:uc_libc_dev/motors/servus.c **** //	Esta função será chamada a cada 10us pelo timer do uC
 274:uc_libc_dev/motors/servus.c **** static void servus_CallSytem(void) {
 105              		.loc 1 274 0
 106              		.cfi_startproc
 107              		@ args = 0, pretend = 0, frame = 0
 108              		@ frame_needed = 0, uses_anonymous_args = 0
 109              	.LVL2:
 110 0000 F8B5     		push	{r3, r4, r5, r6, r7, lr}
 111              	.LCFI0:
 112              		.cfi_def_cfa_offset 24
 113              		.cfi_offset 3, -24
 114              		.cfi_offset 4, -20
 115              		.cfi_offset 5, -16
 116              		.cfi_offset 6, -12
 117              		.cfi_offset 7, -8
 118              		.cfi_offset 14, -4
 275:uc_libc_dev/motors/servus.c **** 	// ###############################################################################################
 276:uc_libc_dev/motors/servus.c **** 	// CONTROLE DOS SERVOS
 277:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
 119              		.loc 1 277 0
 120 0002 0024     		movs	r4, #0
 278:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 279:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].interval_count+=10;
 280:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 281:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdOFF);
 282:uc_libc_dev/motors/servus.c **** 		} else if (servoCtrl[x].pos_count < servoCtrl[x].pos) {
 283:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count+=10;
 284:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 285:uc_libc_dev/motors/servus.c **** 		} else {
 286:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].interval_count = 0;
 121              		.loc 1 286 0
 122 0004 2546     		mov	r5, r4
 278:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 123              		.loc 1 278 0
 124 0006 4C4E     		ldr	r6, .L60
 125 0008 1427     		movs	r7, #20
 126              	.LVL3:
 127              	.L38:
 128 000a 07FB0463 		mla	r3, r7, r4, r6
 129 000e 1969     		ldr	r1, [r3, #16]
 130 0010 5A68     		ldr	r2, [r3, #4]
 131 0012 C2F59C42 		rsb	r2, r2, #19968
 132 0016 2032     		adds	r2, r2, #32
 133 0018 9142     		cmp	r1, r2
 134 001a 05D2     		bcs	.L35
 279:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 135              		.loc 1 279 0
 136 001c 1A69     		ldr	r2, [r3, #16]
 281:uc_libc_dev/motors/servus.c **** 		} else if (servoCtrl[x].pos_count < servoCtrl[x].pos) {
 137              		.loc 1 281 0
 138 001e 0021     		movs	r1, #0
 279:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 139              		.loc 1 279 0
 140 0020 0A32     		adds	r2, r2, #10
 141 0022 1A61     		str	r2, [r3, #16]
 280:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdOFF);
 142              		.loc 1 280 0
 143 0024 DD60     		str	r5, [r3, #12]
 144 0026 07E0     		b	.L59
 145              	.L35:
 282:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count+=10;
 146              		.loc 1 282 0
 147 0028 D968     		ldr	r1, [r3, #12]
 148 002a 5A68     		ldr	r2, [r3, #4]
 149 002c 9142     		cmp	r1, r2
 150 002e 07D2     		bcs	.L37
 283:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 151              		.loc 1 283 0
 152 0030 DA68     		ldr	r2, [r3, #12]
 284:uc_libc_dev/motors/servus.c **** 		} else {
 153              		.loc 1 284 0
 154 0032 0121     		movs	r1, #1
 283:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 155              		.loc 1 283 0
 156 0034 0A32     		adds	r2, r2, #10
 157 0036 DA60     		str	r2, [r3, #12]
 158              	.L59:
 284:uc_libc_dev/motors/servus.c **** 		} else {
 159              		.loc 1 284 0
 160 0038 2046     		mov	r0, r4
 161 003a FFF7FEFF 		bl	servus_SetPin
 162              	.LVL4:
 163 003e 02E0     		b	.L36
 164              	.L37:
 165              		.loc 1 286 0
 166 0040 1D61     		str	r5, [r3, #16]
 287:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos = servoCtrl[x].pos_load;
 167              		.loc 1 287 0
 168 0042 9A68     		ldr	r2, [r3, #8]
 169 0044 5A60     		str	r2, [r3, #4]
 170              	.L36:
 277:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 171              		.loc 1 277 0 discriminator 2
 172 0046 0134     		adds	r4, r4, #1
 173              	.LVL5:
 174 0048 062C     		cmp	r4, #6
 175 004a DED1     		bne	.L38
 288:uc_libc_dev/motors/servus.c **** 		}
 289:uc_libc_dev/motors/servus.c **** 	}
 290:uc_libc_dev/motors/servus.c **** 
 291:uc_libc_dev/motors/servus.c **** 	// ###############################################################################################
 292:uc_libc_dev/motors/servus.c **** 	// CONTROLE DO MÓDULOS ULTRASOM
 293:uc_libc_dev/motors/servus.c **** 	#if (US04_USES == pdON)
 294:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdOFF
 295:uc_libc_dev/motors/servus.c **** 	if (us04.measure == 0) return;
 176              		.loc 1 295 0
 177 004c 3B4B     		ldr	r3, .L60+4
 178 004e 1A68     		ldr	r2, [r3]
 179 0050 9107     		lsls	r1, r2, #30
 180 0052 70D5     		bpl	.L34
 181              	.LBB20:
 182              	.LBB21:
 296:uc_libc_dev/motors/servus.c **** 	#endif
 297:uc_libc_dev/motors/servus.c **** 
 298:uc_libc_dev/motors/servus.c **** 	// OS VALORES SÃO BASEADOS NA CHAMADA DO TICK DE ULTRASOM A CADA 10uS
 299:uc_libc_dev/motors/servus.c **** 	// Passo 1 (tempo 0uS)			: Desligar trigger do módulo e manter por 10uS
 300:uc_libc_dev/motors/servus.c **** 	// Passo 2 (tempo 10uS)			: Ligar trigger do módulo e manter por 10uS
 301:uc_libc_dev/motors/servus.c **** 	// Passo 3 (tempo 20uS)			: Desligar o trigger e dar inicio do tempo para exicitação do ultrasom (
 302:uc_libc_dev/motors/servus.c **** 	// Passo 4 (tempo 420uS a 38ms)	: Inicio da verificação do sinal do eco. Se a primeira leitura for
 303:uc_libc_dev/motors/servus.c **** 	// Passo 5 (tempo MIN 60ms)		: Reiniciar o gerenciador para a próxima leitura. Acrescentado um tem
 304:uc_libc_dev/motors/servus.c **** 
 305:uc_libc_dev/motors/servus.c **** 	// EMITIR SINAL DE TRIGGER. Iniciar em 1 para que os triggers fiquem pelo menos 10us em nível baix
 306:uc_libc_dev/motors/servus.c **** 	if (us04.FCont == 1) {
 183              		.loc 1 306 0
 184 0054 DA68     		ldr	r2, [r3, #12]
 185 0056 012A     		cmp	r2, #1
 186 0058 16D1     		bne	.L40
 307:uc_libc_dev/motors/servus.c **** 		us04_Trigger(us04.FModule, pdON); 				// Emitir sinal de trigger para o módulo atual
 187              		.loc 1 307 0
 188 005a 1A69     		ldr	r2, [r3, #16]
 189              	.LVL6:
 308:uc_libc_dev/motors/servus.c **** 		if (us04.modeContinuous == 0) us04.done = 0;	// Medições não pronta
 190              		.loc 1 308 0
 191 005c 3748     		ldr	r0, .L60+4
 192              	.LBB22:
 193              	.LBB23:
 165:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 194              		.loc 1 165 0
 195 005e 012A     		cmp	r2, #1
 196              	.LVL7:
 197              	.LBB24:
 198              	.LBB25:
 199 0060 02BF     		ittt	eq
 200 0062 374A     		ldreq	r2, .L60+8
 201              	.LVL8:
 202 0064 4FF48041 		moveq	r1, #16384
 203 0068 1160     		streq	r1, [r2]
 204              	.LVL9:
 205              	.LBE25:
 206              	.LBE24:
 207              	.LBE23:
 208              	.LBE22:
 209              		.loc 1 308 0
 210 006a 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 211 006c 12F00101 		ands	r1, r2, #1
 212 0070 02BF     		ittt	eq
 213 0072 0278     		ldrbeq	r2, [r0]	@ zero_extendqisi2
 214 0074 61F38202 		bfieq	r2, r1, #2, #1
 215 0078 0270     		strbeq	r2, [r0]
 309:uc_libc_dev/motors/servus.c **** 		us04.measurements[us04.FModule-1] = 0;			// limpar distancia registrada do módulo atual
 216              		.loc 1 309 0
 217 007a 1A69     		ldr	r2, [r3, #16]
 218 007c 0021     		movs	r1, #0
 219 007e 0332     		adds	r2, r2, #3
 220 0080 03EB8202 		add	r2, r3, r2, lsl #2
 221 0084 5160     		str	r1, [r2, #4]
 222 0086 26E0     		b	.L43
 223              	.LVL10:
 224              	.L40:
 310:uc_libc_dev/motors/servus.c **** 
 311:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 312:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGER_SET = US04_DBGTRIGGER;
 313:uc_libc_dev/motors/servus.c **** 		#endif
 314:uc_libc_dev/motors/servus.c **** 
 315:uc_libc_dev/motors/servus.c **** 	// DESLIGAR TRIGGER E ESPERAR PELA EXICITAÇÃO DO ULTRASOM
 316:uc_libc_dev/motors/servus.c **** 	} else if (us04.FCont == 2) {
 225              		.loc 1 316 0
 226 0088 DA68     		ldr	r2, [r3, #12]
 227 008a 022A     		cmp	r2, #2
 228 008c 07D1     		bne	.L44
 317:uc_libc_dev/motors/servus.c **** 		us04_Trigger(us04.FModule, pdOFF); 		// Desligar sinal de trigger
 229              		.loc 1 317 0
 230 008e 1A69     		ldr	r2, [r3, #16]
 231              	.LVL11:
 232              	.LBB26:
 233              	.LBB27:
 165:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 234              		.loc 1 165 0
 235 0090 012A     		cmp	r2, #1
 236 0092 20D1     		bne	.L43
 237              	.LVL12:
 238              	.LBB28:
 239              	.LBB29:
 240 0094 2B4A     		ldr	r2, .L60+12
 241              	.LVL13:
 242 0096 4FF48041 		mov	r1, #16384
 243 009a 1160     		str	r1, [r2]
 244 009c 1BE0     		b	.L43
 245              	.LVL14:
 246              	.L44:
 247              	.LBE29:
 248              	.LBE28:
 249              	.LBE27:
 250              	.LBE26:
 318:uc_libc_dev/motors/servus.c **** 
 319:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 320:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGER_CLR = US04_DBGTRIGGER;
 321:uc_libc_dev/motors/servus.c **** 		#endif
 322:uc_libc_dev/motors/servus.c **** 
 323:uc_libc_dev/motors/servus.c **** 	// INICIO DA VERIFICAÇÃO DA DETECÇÃO DE OBTÁCULO (entre 420us a 38000us)
 324:uc_libc_dev/motors/servus.c **** 	} else if ( (us04.FCont > 42) && (us04.FCont <= 3800) ) {
 251              		.loc 1 324 0
 252 009e DA68     		ldr	r2, [r3, #12]
 253 00a0 2A2A     		cmp	r2, #42
 254 00a2 18D9     		bls	.L43
 255 00a4 40F6D862 		movw	r2, #3800
 256 00a8 D968     		ldr	r1, [r3, #12]
 257 00aa 9142     		cmp	r1, r2
 258 00ac 13D8     		bhi	.L43
 325:uc_libc_dev/motors/servus.c **** 		if (us04.Ftriggerok == 0) 										// Checa se o módulo aceitou o pedido do trigger
 259              		.loc 1 325 0
 260 00ae 9A68     		ldr	r2, [r3, #8]
 261 00b0 42B9     		cbnz	r2, .L45
 326:uc_libc_dev/motors/servus.c **** 			us04.Ftriggerok = us04_Echo(us04.FModule); 						// Verificar se o módulo aceitou o trigger (ech
 262              		.loc 1 326 0
 263 00b2 1969     		ldr	r1, [r3, #16]
 264              	.LVL15:
 265              	.LBB30:
 266              	.LBB31:
 180:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 267              		.loc 1 180 0
 268 00b4 0129     		cmp	r1, #1
 269              	.LVL16:
 270              	.LBB32:
 271              	.LBB33:
 272 00b6 02BF     		ittt	eq
 273 00b8 234A     		ldreq	r2, .L60+16
 274 00ba 1268     		ldreq	r2, [r2]
 275              	.LBE33:
 276              	.LBE32:
 179:uc_libc_dev/motors/servus.c **** 	if ((module == 1) && (us04_EchoModule1() > 0)) result = 1;
 277              		.loc 1 179 0
 278 00bc C2F3C032 		ubfxeq	r2, r2, #15, #1
 279              	.LVL17:
 280              	.LBE31:
 281              	.LBE30:
 282              		.loc 1 326 0
 283 00c0 9A60     		str	r2, [r3, #8]
 284 00c2 08E0     		b	.L43
 285              	.LVL18:
 286              	.L45:
 327:uc_libc_dev/motors/servus.c **** 		else if (us04.Fdetected == 0) { 									// Checa se ainda não registramos a distancia do objeto 
 287              		.loc 1 327 0
 288 00c4 5A68     		ldr	r2, [r3, #4]
 289 00c6 32B9     		cbnz	r2, .L43
 328:uc_libc_dev/motors/servus.c **** 			if (us04_Echo(us04.FModule) == 0) { 					// Checa se há objeto detectado (echo = 0)
 290              		.loc 1 328 0
 291 00c8 1A69     		ldr	r2, [r3, #16]
 292              	.LVL19:
 293              	.LBB34:
 294              	.LBB35:
 180:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 295              		.loc 1 180 0
 296 00ca 012A     		cmp	r2, #1
 297 00cc 26D1     		bne	.L47
 298              	.LVL20:
 299              	.LBB36:
 300              	.LBB37:
 301 00ce 1E4A     		ldr	r2, .L60+16
 302              	.LVL21:
 303 00d0 1268     		ldr	r2, [r2]
 304 00d2 1204     		lsls	r2, r2, #16
 305 00d4 22D5     		bpl	.L47
 306              	.LVL22:
 307              	.L43:
 308              	.LBE37:
 309              	.LBE36:
 310              	.LBE35:
 311              	.LBE34:
 329:uc_libc_dev/motors/servus.c **** 				us04.measurements[us04.FModule-1] = (us04.FCont-41)*10;		// Registra o tempo da deteção.
 330:uc_libc_dev/motors/servus.c **** 																		// 		Diminuir por 40 (400uS) pois cotarmos a partir da excitação e tempo de inici
 331:uc_libc_dev/motors/servus.c **** 																		// 		Multiplicar por 10 porque estamos contando em 10 e 10 us
 332:uc_libc_dev/motors/servus.c **** 				us04.Fdetected = 1;											// Trava a leitura
 333:uc_libc_dev/motors/servus.c **** 			}
 334:uc_libc_dev/motors/servus.c **** 		}
 335:uc_libc_dev/motors/servus.c **** 
 336:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 337:uc_libc_dev/motors/servus.c **** 		if (us04.Ftriggerok == 1)
 338:uc_libc_dev/motors/servus.c **** 				US04_DBGTRIGGEROK_SET = US04_DBGTRIGGEROK;
 339:uc_libc_dev/motors/servus.c **** 		else	US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
 340:uc_libc_dev/motors/servus.c **** 
 341:uc_libc_dev/motors/servus.c **** 		if (us04.Fdetected == 1)
 342:uc_libc_dev/motors/servus.c **** 				US04_DBGDETECTED_SET = US04_DBGDETECTED;
 343:uc_libc_dev/motors/servus.c **** 		else 	US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 344:uc_libc_dev/motors/servus.c **** 		#endif
 345:uc_libc_dev/motors/servus.c **** 	}
 346:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdON
 347:uc_libc_dev/motors/servus.c **** 	else if (us04.FCont > 3800) {
 348:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
 349:uc_libc_dev/motors/servus.c **** 		US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 350:uc_libc_dev/motors/servus.c **** 	}
 351:uc_libc_dev/motors/servus.c **** 	#endif
 352:uc_libc_dev/motors/servus.c **** 
 353:uc_libc_dev/motors/servus.c **** 	// ESPERAR O TEMPO PARA QUE O MÓDULO FINALIZE O PROCESSO DE MEDIÇÃO (MIN 50MS, MAS ESTAMOS DANDO M
 354:uc_libc_dev/motors/servus.c **** 	if (us04.FCont == US04_END_MEASURE) {
 312              		.loc 1 354 0
 313 00d6 41F27071 		movw	r1, #6000
 314 00da D868     		ldr	r0, [r3, #12]
 315 00dc 174A     		ldr	r2, .L60+4
 316 00de 8842     		cmp	r0, r1
 317 00e0 18D1     		bne	.L48
 355:uc_libc_dev/motors/servus.c **** 		// Ir para o próximo módulo ou finalizar a leitura
 356:uc_libc_dev/motors/servus.c **** 		if (us04.FModule == US04_N_MODULE) {
 318              		.loc 1 356 0
 319 00e2 1169     		ldr	r1, [r2, #16]
 320 00e4 0129     		cmp	r1, #1
 321 00e6 0DD1     		bne	.L49
 357:uc_libc_dev/motors/servus.c **** 			us04.FModule = 1;		// Sinaliza para meidor módulo 1
 322              		.loc 1 357 0
 323 00e8 1161     		str	r1, [r2, #16]
 358:uc_libc_dev/motors/servus.c **** 			us04.done = 1;		// Sinaliza que a medição está completa
 324              		.loc 1 358 0
 325 00ea 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 326 00ec 41F00401 		orr	r1, r1, #4
 327 00f0 1170     		strb	r1, [r2]
 359:uc_libc_dev/motors/servus.c **** 			// Caso não for medição de forma continua, sinaliza para parar as medições e esperar pelo próxim
 360:uc_libc_dev/motors/servus.c **** 			if (us04.modeContinuous == 0) us04.measure = 0;
 328              		.loc 1 360 0
 329 00f2 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 330 00f4 11F00100 		ands	r0, r1, #1
 331 00f8 07D1     		bne	.L50
 332 00fa 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 333 00fc 60F34101 		bfi	r1, r0, #1, #1
 334 0100 1170     		strb	r1, [r2]
 335 0102 02E0     		b	.L50
 336              	.L49:
 361:uc_libc_dev/motors/servus.c **** 		} else us04.FModule++;		// Sinaliza para medir o próximo módulo
 337              		.loc 1 361 0
 338 0104 1169     		ldr	r1, [r2, #16]
 339 0106 0131     		adds	r1, r1, #1
 340 0108 1161     		str	r1, [r2, #16]
 341              	.L50:
 362:uc_libc_dev/motors/servus.c **** 
 363:uc_libc_dev/motors/servus.c **** 		us04.FCont = 0;
 342              		.loc 1 363 0
 343 010a 0022     		movs	r2, #0
 344 010c DA60     		str	r2, [r3, #12]
 364:uc_libc_dev/motors/servus.c **** 		us04.Fdetected = 0;;		// Sinaliza para não há objeto detectado
 345              		.loc 1 364 0
 346 010e 5A60     		str	r2, [r3, #4]
 365:uc_libc_dev/motors/servus.c **** 		us04.Ftriggerok = 0;		// Inicializar pedido de trigger
 347              		.loc 1 365 0
 348 0110 9A60     		str	r2, [r3, #8]
 349 0112 F8BD     		pop	{r3, r4, r5, r6, r7, pc}
 350              	.LVL23:
 351              	.L48:
 366:uc_libc_dev/motors/servus.c **** 	} else
 367:uc_libc_dev/motors/servus.c **** 		us04.FCont++;
 352              		.loc 1 367 0
 353 0114 D368     		ldr	r3, [r2, #12]
 354 0116 0133     		adds	r3, r3, #1
 355 0118 D360     		str	r3, [r2, #12]
 356 011a F8BD     		pop	{r3, r4, r5, r6, r7, pc}
 357              	.LVL24:
 358              	.L47:
 329:uc_libc_dev/motors/servus.c **** 																		// 		Diminuir por 40 (400uS) pois cotarmos a partir da excitação e tempo de inici
 359              		.loc 1 329 0
 360 011c 1A69     		ldr	r2, [r3, #16]
 361 011e D868     		ldr	r0, [r3, #12]
 362 0120 0A21     		movs	r1, #10
 363 0122 4143     		muls	r1, r0, r1
 364 0124 0332     		adds	r2, r2, #3
 365 0126 03EB8202 		add	r2, r3, r2, lsl #2
 366 012a A1F5CD71 		sub	r1, r1, #410
 367 012e 5160     		str	r1, [r2, #4]
 332:uc_libc_dev/motors/servus.c **** 			}
 368              		.loc 1 332 0
 369 0130 0122     		movs	r2, #1
 370 0132 5A60     		str	r2, [r3, #4]
 371 0134 CFE7     		b	.L43
 372              	.L34:
 373 0136 F8BD     		pop	{r3, r4, r5, r6, r7, pc}
 374              	.LVL25:
 375              	.L61:
 376              		.align	2
 377              	.L60:
 378 0138 00000000 		.word	.LANCHOR0
 379 013c 00000000 		.word	.LANCHOR1
 380 0140 38C00920 		.word	537509944
 381 0144 3CC00920 		.word	537509948
 382 0148 34C00920 		.word	537509940
 383              	.LBE21:
 384              	.LBE20:
 385              		.cfi_endproc
 386              	.LFE11:
 388              		.section	.text.servus_Init,"ax",%progbits
 389              		.align	1
 390              		.global	servus_Init
 391              		.thumb
 392              		.thumb_func
 394              	servus_Init:
 395              	.LFB0:
  60:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
 396              		.loc 1 60 0
 397              		.cfi_startproc
 398              		@ args = 0, pretend = 0, frame = 0
 399              		@ frame_needed = 0, uses_anonymous_args = 0
 400              	.LVL26:
 401 0000 F8B5     		push	{r3, r4, r5, r6, r7, lr}
 402              	.LCFI1:
 403              		.cfi_def_cfa_offset 24
 404              		.cfi_offset 3, -24
 405              		.cfi_offset 4, -20
 406              		.cfi_offset 5, -16
 407              		.cfi_offset 6, -12
 408              		.cfi_offset 7, -8
 409              		.cfi_offset 14, -4
  61:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 410              		.loc 1 61 0
 411 0002 0023     		movs	r3, #0
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 412              		.loc 1 62 0
 413 0004 1E46     		mov	r6, r3
  64:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
 414              		.loc 1 64 0
 415 0006 40F2DC57 		movw	r7, #1500
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 416              		.loc 1 62 0
 417 000a 314D     		ldr	r5, .L65
 418 000c 4FF0140E 		mov	lr, #20
  65:uc_libc_dev/motors/servus.c **** 	}
 419              		.loc 1 65 0
 420 0010 00F00100 		and	r0, r0, #1
 421              	.LVL27:
 422              	.L63:
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 423              		.loc 1 62 0 discriminator 3
 424 0014 0EFB03F1 		mul	r1, lr, r3
 425 0018 6A18     		adds	r2, r5, r1
 426 001a 1661     		str	r6, [r2, #16]
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos= 1500;
 427              		.loc 1 63 0 discriminator 3
 428 001c D660     		str	r6, [r2, #12]
  64:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
 429              		.loc 1 64 0 discriminator 3
 430 001e 5760     		str	r7, [r2, #4]
  65:uc_libc_dev/motors/servus.c **** 	}
 431              		.loc 1 65 0 discriminator 3
 432 0020 6A5C     		ldrb	r2, [r5, r1]	@ zero_extendqisi2
  61:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 433              		.loc 1 61 0 discriminator 3
 434 0022 0133     		adds	r3, r3, #1
 435              	.LVL28:
  65:uc_libc_dev/motors/servus.c **** 	}
 436              		.loc 1 65 0 discriminator 3
 437 0024 60F30002 		bfi	r2, r0, #0, #1
  61:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 438              		.loc 1 61 0 discriminator 3
 439 0028 062B     		cmp	r3, #6
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 440              		.loc 1 62 0 discriminator 3
 441 002a 4FF00004 		mov	r4, #0
  65:uc_libc_dev/motors/servus.c **** 	}
 442              		.loc 1 65 0 discriminator 3
 443 002e 6A54     		strb	r2, [r5, r1]
  61:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 444              		.loc 1 61 0 discriminator 3
 445 0030 F0D1     		bne	.L63
  69:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 446              		.loc 1 69 0
 447 0032 284B     		ldr	r3, .L65+4
 448              	.LVL29:
 449 0034 2848     		ldr	r0, .L65+8
 450 0036 1A68     		ldr	r2, [r3]
 451 0038 42F48042 		orr	r2, r2, #16384
 452 003c 1A60     		str	r2, [r3]
 453 003e 4FF48042 		mov	r2, #16384
 454 0042 0260     		str	r2, [r0]
  80:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 			// Sinaliza para não fazer as medições
 455              		.loc 1 80 0
 456 0044 254A     		ldr	r2, .L65+12
 457 0046 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 458 0048 64F30001 		bfi	r1, r4, #0, #1
 459 004c 1170     		strb	r1, [r2]
  81:uc_libc_dev/motors/servus.c **** 	us04.done = 0;				// Nenhuma medição foi realizada ainda
 460              		.loc 1 81 0
 461 004e 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 462 0050 64F34101 		bfi	r1, r4, #1, #1
 463 0054 1170     		strb	r1, [r2]
  82:uc_libc_dev/motors/servus.c **** 	us04.FModule = 1;			// Sinaliza que o módulo 1 será o primeiro a ser medido
 464              		.loc 1 82 0
 465 0056 1178     		ldrb	r1, [r2]	@ zero_extendqisi2
 466 0058 64F38201 		bfi	r1, r4, #2, #1
 467 005c 1170     		strb	r1, [r2]
  83:uc_libc_dev/motors/servus.c **** 	us04.FCont = 0;				// Contador em micro segundos do CallSystem do US
 468              		.loc 1 83 0
 469 005e 0121     		movs	r1, #1
 470 0060 1161     		str	r1, [r2, #16]
  84:uc_libc_dev/motors/servus.c **** 
 471              		.loc 1 84 0
 472 0062 D460     		str	r4, [r2, #12]
 473              	.LVL30:
  87:uc_libc_dev/motors/servus.c **** 		us04_Trigger(x, pdOFF); // Desligar sinais dos triggers dos módulos
 474              		.loc 1 87 0
 475 0064 5461     		str	r4, [r2, #20]
 476              	.LVL31:
  91:uc_libc_dev/motors/servus.c **** 	us04.Ftriggerok = 0;		// Inicializar pedido de trigger
 477              		.loc 1 91 0
 478 0066 5460     		str	r4, [r2, #4]
  92:uc_libc_dev/motors/servus.c **** 
 479              		.loc 1 92 0
 480 0068 9460     		str	r4, [r2, #8]
 104:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 481              		.loc 1 104 0
 482 006a 1A68     		ldr	r2, [r3]
 483 006c 42F48062 		orr	r2, r2, #1024
 484 0070 1A60     		str	r2, [r3]
 485 0072 4FF48062 		mov	r2, #1024
 486 0076 0260     		str	r2, [r0]
 106:uc_libc_dev/motors/servus.c **** 	#endif
 487              		.loc 1 106 0
 488 0078 1A68     		ldr	r2, [r3]
 489 007a 42F40072 		orr	r2, r2, #512
 490 007e 1A60     		str	r2, [r3]
 491 0080 4FF40072 		mov	r2, #512
 492 0084 0260     		str	r2, [r0]
 109:uc_libc_dev/motors/servus.c **** 	#endif
 493              		.loc 1 109 0
 494 0086 1A68     		ldr	r2, [r3]
 495 0088 42F48072 		orr	r2, r2, #256
 496 008c 1A60     		str	r2, [r3]
 497 008e 4FF48072 		mov	r2, #256
 498 0092 0260     		str	r2, [r0]
 112:uc_libc_dev/motors/servus.c **** 	#endif
 499              		.loc 1 112 0
 500 0094 1A68     		ldr	r2, [r3]
 501 0096 42F01002 		orr	r2, r2, #16
 502 009a 1A60     		str	r2, [r3]
 503 009c 1022     		movs	r2, #16
 504 009e 0260     		str	r2, [r0]
 115:uc_libc_dev/motors/servus.c **** 	#endif
 505              		.loc 1 115 0
 506 00a0 1A68     		ldr	r2, [r3]
 507 00a2 42F00202 		orr	r2, r2, #2
 508 00a6 1A60     		str	r2, [r3]
 509 00a8 0222     		movs	r2, #2
 510 00aa 0260     		str	r2, [r0]
 118:uc_libc_dev/motors/servus.c **** 	#endif
 511              		.loc 1 118 0
 512 00ac 1A68     		ldr	r2, [r3]
 513 00ae 0A43     		orrs	r2, r2, r1
 514 00b0 1A60     		str	r2, [r3]
 515 00b2 0160     		str	r1, [r0]
 124:uc_libc_dev/motors/servus.c **** 	servus_SetIntHandler(servus_CallSytem);
 516              		.loc 1 124 0
 517 00b4 0322     		movs	r2, #3
 518 00b6 0846     		mov	r0, r1
 519 00b8 FFF7FEFF 		bl	timer1_Init
 520              	.LVL32:
 521 00bc FA20     		movs	r0, #250
 522 00be FFF7FEFF 		bl	timer1_SetMatch0
 523              	.LVL33:
 125:uc_libc_dev/motors/servus.c **** }
 524              		.loc 1 125 0
 525 00c2 2046     		mov	r0, r4
 126:uc_libc_dev/motors/servus.c **** 
 526              		.loc 1 126 0
 527 00c4 BDE8F840 		pop	{r3, r4, r5, r6, r7, lr}
 528              	.LCFI2:
 529              		.cfi_restore 14
 530              		.cfi_restore 7
 531              		.cfi_restore 6
 532              		.cfi_restore 5
 533              		.cfi_restore 4
 534              		.cfi_restore 3
 535              		.cfi_def_cfa_offset 0
 125:uc_libc_dev/motors/servus.c **** }
 536              		.loc 1 125 0
 537 00c8 0549     		ldr	r1, .L65+16
 538 00ca FFF7FEBF 		b	timer1_SetIntHandler
 539              	.LVL34:
 540              	.L66:
 541 00ce 00BF     		.align	2
 542              	.L65:
 543 00d0 00000000 		.word	.LANCHOR0
 544 00d4 20C00920 		.word	537509920
 545 00d8 3CC00920 		.word	537509948
 546 00dc 00000000 		.word	.LANCHOR1
 547 00e0 00000000 		.word	servus_CallSytem
 548              		.cfi_endproc
 549              	.LFE0:
 551              		.section	.text.servus_Finish,"ax",%progbits
 552              		.align	1
 553              		.global	servus_Finish
 554              		.thumb
 555              		.thumb_func
 557              	servus_Finish:
 558              	.LFB1:
 128:uc_libc_dev/motors/servus.c **** 	servus_TimeStop();		// Desligo o timer para não gerar int para servus_CallSytem
 559              		.loc 1 128 0
 560              		.cfi_startproc
 561              		@ args = 0, pretend = 0, frame = 0
 562              		@ frame_needed = 0, uses_anonymous_args = 0
 563              		@ link register save eliminated.
 129:uc_libc_dev/motors/servus.c **** }
 564              		.loc 1 129 0
 565 0000 0020     		movs	r0, #0
 566 0002 FFF7FEBF 		b	timer1_Set
 567              	.LVL35:
 568              		.cfi_endproc
 569              	.LFE1:
 571              		.section	.text.us04_StartMeasure,"ax",%progbits
 572              		.align	1
 573              		.global	us04_StartMeasure
 574              		.thumb
 575              		.thumb_func
 577              	us04_StartMeasure:
 578              	.LFB2:
 138:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = modeCont;
 579              		.loc 1 138 0
 580              		.cfi_startproc
 581              		@ args = 0, pretend = 0, frame = 0
 582              		@ frame_needed = 0, uses_anonymous_args = 0
 583              		@ link register save eliminated.
 584              	.LVL36:
 139:uc_libc_dev/motors/servus.c **** 	if (us04.measure) return;
 585              		.loc 1 139 0
 586 0000 084B     		ldr	r3, .L70
 587 0002 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 588 0004 60F30002 		bfi	r2, r0, #0, #1
 589 0008 1A70     		strb	r2, [r3]
 140:uc_libc_dev/motors/servus.c **** 	us04.done = 0; 			// Sinaliza que a conversão não está pronta
 590              		.loc 1 140 0
 591 000a 1968     		ldr	r1, [r3]
 592 000c C1F34001 		ubfx	r1, r1, #1, #1
 593 0010 39B9     		cbnz	r1, .L68
 141:uc_libc_dev/motors/servus.c **** 	us04.measure = 1; 		// Sinaliza para fazer as medições
 594              		.loc 1 141 0
 595 0012 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 596 0014 61F38202 		bfi	r2, r1, #2, #1
 597 0018 1A70     		strb	r2, [r3]
 142:uc_libc_dev/motors/servus.c **** }
 598              		.loc 1 142 0
 599 001a 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 600 001c 42F00202 		orr	r2, r2, #2
 601 0020 1A70     		strb	r2, [r3]
 602              	.L68:
 603 0022 7047     		bx	lr
 604              	.L71:
 605              		.align	2
 606              	.L70:
 607 0024 00000000 		.word	.LANCHOR1
 608              		.cfi_endproc
 609              	.LFE2:
 611              		.section	.text.us04_StopMeasure,"ax",%progbits
 612              		.align	1
 613              		.global	us04_StopMeasure
 614              		.thumb
 615              		.thumb_func
 617              	us04_StopMeasure:
 618              	.LFB3:
 146:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = 0;
 619              		.loc 1 146 0
 620              		.cfi_startproc
 621              		@ args = 0, pretend = 0, frame = 0
 622              		@ frame_needed = 0, uses_anonymous_args = 0
 623              		@ link register save eliminated.
 147:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 		// Sinaliza para fazer as medições
 624              		.loc 1 147 0
 625 0000 044B     		ldr	r3, .L73
 626 0002 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 627 0004 6FF30002 		bfc	r2, #0, #1
 628 0008 1A70     		strb	r2, [r3]
 148:uc_libc_dev/motors/servus.c **** }
 629              		.loc 1 148 0
 630 000a 1A78     		ldrb	r2, [r3]	@ zero_extendqisi2
 631 000c 6FF34102 		bfc	r2, #1, #1
 632 0010 1A70     		strb	r2, [r3]
 633 0012 7047     		bx	lr
 634              	.L74:
 635              		.align	2
 636              	.L73:
 637 0014 00000000 		.word	.LANCHOR1
 638              		.cfi_endproc
 639              	.LFE3:
 641              		.section	.text.us04_ReadMeasureCM,"ax",%progbits
 642              		.align	1
 643              		.global	us04_ReadMeasureCM
 644              		.thumb
 645              		.thumb_func
 647              	us04_ReadMeasureCM:
 648              	.LFB4:
 156:uc_libc_dev/motors/servus.c **** 	if ( (module == 0) || (module > US04_N_MODULE)) return errDEVICE_NOT_FOUND;
 649              		.loc 1 156 0
 650              		.cfi_startproc
 651              		@ args = 0, pretend = 0, frame = 0
 652              		@ frame_needed = 0, uses_anonymous_args = 0
 653              		@ link register save eliminated.
 654              	.LVL37:
 157:uc_libc_dev/motors/servus.c **** 	if (us04.done == 0) return errDEVICE_VALUE_NOT_READY;
 655              		.loc 1 157 0
 656 0000 0128     		cmp	r0, #1
 657 0002 0AD1     		bne	.L77
 158:uc_libc_dev/motors/servus.c **** 	if (us04.measurements[module-1] == 0) return 0;
 658              		.loc 1 158 0
 659 0004 074B     		ldr	r3, .L80
 660 0006 1A68     		ldr	r2, [r3]
 661 0008 5207     		lsls	r2, r2, #29
 662 000a 08D5     		bpl	.L78
 159:uc_libc_dev/motors/servus.c **** 	return (us04.measurements[module-1]/58);
 663              		.loc 1 159 0
 664 000c 5869     		ldr	r0, [r3, #20]
 665              	.LVL38:
 666 000e 38B1     		cbz	r0, .L76
 160:uc_libc_dev/motors/servus.c **** }
 667              		.loc 1 160 0
 668 0010 5B69     		ldr	r3, [r3, #20]
 669 0012 3A20     		movs	r0, #58
 670 0014 B3FBF0F0 		udiv	r0, r3, r0
 671 0018 7047     		bx	lr
 672              	.LVL39:
 673              	.L77:
 157:uc_libc_dev/motors/servus.c **** 	if (us04.done == 0) return errDEVICE_VALUE_NOT_READY;
 674              		.loc 1 157 0
 675 001a 0348     		ldr	r0, .L80+4
 676              	.LVL40:
 677 001c 7047     		bx	lr
 678              	.LVL41:
 679              	.L78:
 158:uc_libc_dev/motors/servus.c **** 	if (us04.measurements[module-1] == 0) return 0;
 680              		.loc 1 158 0
 681 001e 0348     		ldr	r0, .L80+8
 682              	.LVL42:
 683              	.L76:
 161:uc_libc_dev/motors/servus.c **** 
 684              		.loc 1 161 0
 685 0020 7047     		bx	lr
 686              	.L81:
 687 0022 00BF     		.align	2
 688              	.L80:
 689 0024 00000000 		.word	.LANCHOR1
 690 0028 D4FEFFFF 		.word	-300
 691 002c D2FEFFFF 		.word	-302
 692              		.cfi_endproc
 693              	.LFE4:
 695              		.section	.text.servus_SetPos,"ax",%progbits
 696              		.align	1
 697              		.global	servus_SetPos
 698              		.thumb
 699              		.thumb_func
 701              	servus_SetPos:
 702              	.LFB7:
 201:uc_libc_dev/motors/servus.c **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 703              		.loc 1 201 0
 704              		.cfi_startproc
 705              		@ args = 0, pretend = 0, frame = 0
 706              		@ frame_needed = 0, uses_anonymous_args = 0
 707              		@ link register save eliminated.
 708              	.LVL43:
 202:uc_libc_dev/motors/servus.c **** 	if ( (us<minSERVO_US_WIDTH) || (us>maxSERVO_US_WIDTH)) return errDEVICE_VALUE_INVALID;
 709              		.loc 1 202 0
 710 0000 0138     		subs	r0, r0, #1
 711              	.LVL44:
 712 0002 0528     		cmp	r0, #5
 713 0004 10D8     		bhi	.L84
 203:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = (us/10)*10;
 714              		.loc 1 203 0
 715 0006 40F63C73 		movw	r3, #3900
 716 000a A1F16402 		sub	r2, r1, #100
 717 000e 9A42     		cmp	r2, r3
 718 0010 0CD8     		bhi	.L85
 204:uc_libc_dev/motors/servus.c **** 
 719              		.loc 1 204 0
 720 0012 0A23     		movs	r3, #10
 721 0014 B1FBF3F1 		udiv	r1, r1, r3
 722              	.LVL45:
 723 0018 064A     		ldr	r2, .L86
 724              	.LVL46:
 725 001a 4B43     		muls	r3, r1, r3
 726 001c 1421     		movs	r1, #20
 727 001e 01FB0020 		mla	r0, r1, r0, r2
 728              	.LVL47:
 729 0022 8360     		str	r3, [r0, #8]
 206:uc_libc_dev/motors/servus.c **** }
 730              		.loc 1 206 0
 731 0024 0120     		movs	r0, #1
 732 0026 7047     		bx	lr
 733              	.LVL48:
 734              	.L84:
 202:uc_libc_dev/motors/servus.c **** 	if ( (us<minSERVO_US_WIDTH) || (us>maxSERVO_US_WIDTH)) return errDEVICE_VALUE_INVALID;
 735              		.loc 1 202 0
 736 0028 0348     		ldr	r0, .L86+4
 737 002a 7047     		bx	lr
 738              	.L85:
 203:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = (us/10)*10;
 739              		.loc 1 203 0
 740 002c 6FF49770 		mvn	r0, #302
 207:uc_libc_dev/motors/servus.c **** 
 741              		.loc 1 207 0
 742 0030 7047     		bx	lr
 743              	.L87:
 744 0032 00BF     		.align	2
 745              	.L86:
 746 0034 00000000 		.word	.LANCHOR0
 747 0038 D4FEFFFF 		.word	-300
 748              		.cfi_endproc
 749              	.LFE7:
 751              		.section	.text.servus_Enable,"ax",%progbits
 752              		.align	1
 753              		.global	servus_Enable
 754              		.thumb
 755              		.thumb_func
 757              	servus_Enable:
 758              	.LFB8:
 213:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 759              		.loc 1 213 0
 760              		.cfi_startproc
 761              		@ args = 0, pretend = 0, frame = 0
 762              		@ frame_needed = 0, uses_anonymous_args = 0
 763              		@ link register save eliminated.
 764              	.LVL49:
 214:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 765              		.loc 1 214 0
 766 0000 0138     		subs	r0, r0, #1
 767              	.LVL50:
 768 0002 0528     		cmp	r0, #5
 769 0004 0BD8     		bhi	.L90
 215:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 770              		.loc 1 215 0
 771 0006 1423     		movs	r3, #20
 772 0008 5843     		muls	r0, r3, r0
 773              	.LVL51:
 774 000a 064A     		ldr	r2, .L91
 775 000c 0031     		adds	r1, r1, #0
 776 000e 135C     		ldrb	r3, [r2, r0]	@ zero_extendqisi2
 777 0010 18BF     		it	ne
 778 0012 0121     		movne	r1, #1
 779              	.LVL52:
 780 0014 61F30003 		bfi	r3, r1, #0, #1
 781 0018 1354     		strb	r3, [r2, r0]
 216:uc_libc_dev/motors/servus.c **** }
 782              		.loc 1 216 0
 783 001a 0120     		movs	r0, #1
 784 001c 7047     		bx	lr
 785              	.LVL53:
 786              	.L90:
 214:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 787              		.loc 1 214 0
 788 001e 0248     		ldr	r0, .L91+4
 217:uc_libc_dev/motors/servus.c **** 
 789              		.loc 1 217 0
 790 0020 7047     		bx	lr
 791              	.L92:
 792 0022 00BF     		.align	2
 793              	.L91:
 794 0024 00000000 		.word	.LANCHOR0
 795 0028 D4FEFFFF 		.word	-300
 796              		.cfi_endproc
 797              	.LFE8:
 799              		.section	.text.servus_Enabled,"ax",%progbits
 800              		.align	1
 801              		.global	servus_Enabled
 802              		.thumb
 803              		.thumb_func
 805              	servus_Enabled:
 806              	.LFB9:
 223:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 807              		.loc 1 223 0
 808              		.cfi_startproc
 809              		@ args = 0, pretend = 0, frame = 0
 810              		@ frame_needed = 0, uses_anonymous_args = 0
 811              		@ link register save eliminated.
 812              	.LVL54:
 224:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 813              		.loc 1 224 0
 814 0000 0138     		subs	r0, r0, #1
 815              	.LVL55:
 816 0002 0528     		cmp	r0, #5
 225:uc_libc_dev/motors/servus.c **** }
 817              		.loc 1 225 0
 818 0004 9FBF     		itttt	ls
 819 0006 1423     		movls	r3, #20
 820 0008 5843     		mulls	r0, r3, r0
 821              	.LVL56:
 822 000a 034B     		ldrls	r3, .L96
 823 000c 1858     		ldrls	r0, [r3, r0]
 824 000e 94BF     		ite	ls
 825 0010 00F00100 		andls	r0, r0, #1
 224:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 826              		.loc 1 224 0
 827 0014 0148     		ldrhi	r0, .L96+4
 226:uc_libc_dev/motors/servus.c **** 
 828              		.loc 1 226 0
 829 0016 7047     		bx	lr
 830              	.L97:
 831              		.align	2
 832              	.L96:
 833 0018 00000000 		.word	.LANCHOR0
 834 001c D4FEFFFF 		.word	-300
 835              		.cfi_endproc
 836              	.LFE9:
 838              		.section	.bss.us04,"aw",%nobits
 839              		.align	2
 840              		.set	.LANCHOR1,. + 0
 843              	us04:
 844 0000 00000000 		.space	24
 844      00000000 
 844      00000000 
 844      00000000 
 844      00000000 
 845              		.section	.bss.servoCtrl,"aw",%nobits
 846              		.align	2
 847              		.set	.LANCHOR0,. + 0
 850              	servoCtrl:
 851 0000 00000000 		.space	120
 851      00000000 
 851      00000000 
 851      00000000 
 851      00000000 
 852              		.text
 853              	.Letext0:
 854              		.file 2 "uc_libc_dev/_libdef/uc_libdefs.h"
 855              		.file 3 "uc_libc_dev/_arch/arm_lpc/timer/timer1.h"
DEFINED SYMBOLS
                            *ABS*:00000000 servus.c
D:\_temp\_windows\ccsc6iln.s:20     .text.servus_SetPin:00000000 $t
D:\_temp\_windows\ccsc6iln.s:24     .text.servus_SetPin:00000000 servus_SetPin
D:\_temp\_windows\ccsc6iln.s:92     .text.servus_SetPin:00000050 $d
D:\_temp\_windows\ccsc6iln.s:99     .text.servus_CallSytem:00000000 $t
D:\_temp\_windows\ccsc6iln.s:103    .text.servus_CallSytem:00000000 servus_CallSytem
D:\_temp\_windows\ccsc6iln.s:378    .text.servus_CallSytem:00000138 $d
D:\_temp\_windows\ccsc6iln.s:389    .text.servus_Init:00000000 $t
D:\_temp\_windows\ccsc6iln.s:394    .text.servus_Init:00000000 servus_Init
D:\_temp\_windows\ccsc6iln.s:543    .text.servus_Init:000000d0 $d
D:\_temp\_windows\ccsc6iln.s:552    .text.servus_Finish:00000000 $t
D:\_temp\_windows\ccsc6iln.s:557    .text.servus_Finish:00000000 servus_Finish
D:\_temp\_windows\ccsc6iln.s:572    .text.us04_StartMeasure:00000000 $t
D:\_temp\_windows\ccsc6iln.s:577    .text.us04_StartMeasure:00000000 us04_StartMeasure
D:\_temp\_windows\ccsc6iln.s:607    .text.us04_StartMeasure:00000024 $d
D:\_temp\_windows\ccsc6iln.s:612    .text.us04_StopMeasure:00000000 $t
D:\_temp\_windows\ccsc6iln.s:617    .text.us04_StopMeasure:00000000 us04_StopMeasure
D:\_temp\_windows\ccsc6iln.s:637    .text.us04_StopMeasure:00000014 $d
D:\_temp\_windows\ccsc6iln.s:642    .text.us04_ReadMeasureCM:00000000 $t
D:\_temp\_windows\ccsc6iln.s:647    .text.us04_ReadMeasureCM:00000000 us04_ReadMeasureCM
D:\_temp\_windows\ccsc6iln.s:689    .text.us04_ReadMeasureCM:00000024 $d
D:\_temp\_windows\ccsc6iln.s:696    .text.servus_SetPos:00000000 $t
D:\_temp\_windows\ccsc6iln.s:701    .text.servus_SetPos:00000000 servus_SetPos
D:\_temp\_windows\ccsc6iln.s:746    .text.servus_SetPos:00000034 $d
D:\_temp\_windows\ccsc6iln.s:752    .text.servus_Enable:00000000 $t
D:\_temp\_windows\ccsc6iln.s:757    .text.servus_Enable:00000000 servus_Enable
D:\_temp\_windows\ccsc6iln.s:794    .text.servus_Enable:00000024 $d
D:\_temp\_windows\ccsc6iln.s:800    .text.servus_Enabled:00000000 $t
D:\_temp\_windows\ccsc6iln.s:805    .text.servus_Enabled:00000000 servus_Enabled
D:\_temp\_windows\ccsc6iln.s:833    .text.servus_Enabled:00000018 $d
D:\_temp\_windows\ccsc6iln.s:839    .bss.us04:00000000 $d
D:\_temp\_windows\ccsc6iln.s:843    .bss.us04:00000000 us04
D:\_temp\_windows\ccsc6iln.s:846    .bss.servoCtrl:00000000 $d
D:\_temp\_windows\ccsc6iln.s:850    .bss.servoCtrl:00000000 servoCtrl
                     .debug_frame:00000010 $d

UNDEFINED SYMBOLS
timer1_Init
timer1_SetMatch0
timer1_SetIntHandler
timer1_Set
